#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *const argv[])
{
  if (argc == 1)
  {
    exit(EXIT_SUCCESS);
  }

  for (size_t i = 1; i < argc; ++i)
  {
    FILE *fp = fopen(argv[i], "r");
    if (fp == NULL)
    {
      fprintf(stdout, "cannot open file\n");
      exit(EXIT_FAILURE);
    }

    char *line = NULL;
    size_t len = 0;
    while (getline(&line, &len, fp) != -1)
    {
      fprintf(stdout, "%s", line);
    }
  }

  exit(EXIT_SUCCESS);
}
